import { get } from '@/utils'
export default () => {
  /**
   * 运费模版
   */
  const transport = ref<any[]>([])
  const getTransport = () => {
    get(
      {
        url: '/server-shop/sys-seller/transport/page',
        data: { current: 1, size: 99 },
      },
      ({ data }) => {
        transport.value = data.records
      }
    )
  }
  /**商户商品分类 */
  const sellerCategory = ref<Classify[]>([])
  const getSellerCategory = () => {
    get({ url: '/server-shop/sys-seller/seller/goods/category/tree' }, ({ data }) => {
      sellerCategory.value = data
    })
  }
  /**平台商品分类 */
  const platformCategory = ref<Classify[]>([])
  const getPlatformCategory = () => {
    get({ url: '/server-shop/sys-seller/goods/category/tree' }, ({ data }) => {
      platformCategory.value = data
    })
  }
  /**商品服务 */
  const serviceList = ref([])
  const getServiceList = () => {
    get({ url: '/server-shop/sys-seller/goods/serve/list' }, ({ data }) => {
      serviceList.value = data
    })
  }
  /**商品标签 */
  const tagList = ref([])
  const getTagList = () => {
    get({ url: '/server-shop/sys-seller/goods/tag/list' }, ({ data }) => {
      tagList.value = data
    })
  }
  return { transport, getTransport, sellerCategory, getSellerCategory, platformCategory, getPlatformCategory, serviceList, getServiceList, tagList, getTagList }
}
